misc
Class Pair<A,B>

java.lang.Object
  extended by misc.Pair<A,B>
Type Parameters:
A - class of the first object.
B - class of the second object.
All Implemented Interfaces:
java.io.Serializable

public class Pair<A,B>
extends java.lang.Object
implements java.io.Serializable

A simple tuple class.

Author:
Alex Dirkzwager, Mark Hendrikx, Julian de Ruiter
See Also:
Serialized Form

Constructor Summary
Pair(A fst, B snd)
          Create a pair from the given two objects.
 
Method Summary
 boolean equals(java.lang.Object other)
           
 A getFirst()
          Return the first object of the pair.
 B getSecond()
          Return the second object of the pair.
 int hashCode()
           
 void setFirst(A v)
          Set the first object of the pair.
 void setSecond(B v)
          Set the second object of the pair.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Pair

public Pair(A fst,
            B snd)
Create a pair from the given two objects.

Parameters:
fst - first object of the pair.
snd - second object of the pair.
Method Detail

getFirst

public A getFirst()
Return the first object of the pair.

Returns:
first object of the pair.

getSecond

public B getSecond()
Return the second object of the pair.

Returns:
second object of the pair.

setFirst

public void setFirst(A v)
Set the first object of the pair.

Parameters:
v - set first object to v.

setSecond

public void setSecond(B v)
Set the second object of the pair.

Parameters:
v - set second object to v.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
string representation of string.

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object
Returns:
true if this and other object are equal.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
Returns:
hashcode of this object.